using System;
using System.Collections.Generic;
using System.Text;
using TowerDefense_Dx.GameLogic;

namespace TowerDefense_Dx
{
    public class TimeList
    {
        private List<Enemy> _enemies;
        public List<Enemy> Enemies
        {
            get { return _enemies; }
            set { _enemies = value; }
        }

        private float _ellapsedTime = 0;
        private float _releaseTime = 0;

        public bool IsEmpty
        {
            get { return _enemies.Count == 0; }
        }
	

        public TimeList(List<Enemy> enemies, float releaseTime)
        {
            _enemies = enemies;
            _releaseTime = releaseTime;
        }

        public Enemy Update(float deltaTime)
        {
            _ellapsedTime += deltaTime;
            if (_ellapsedTime >= _releaseTime)
            {
                if (_enemies.Count > 0)
                {
                    Enemy e = _enemies[0];
                    _enemies.RemoveAt(0);
                    return e;
                }
            }
            return null;
        }

        List<TimeList> _enemiesEachWaves;

    }
}
